package org.example.design.prototype;

import lombok.Data;

import java.io.Serializable;

/**
 * @author huangshen
 * @version 0
 * @description DeepClonePrototype
 * @since 2022/1/30 19:18
 */
@Data
public class CloneSheep implements Serializable, Cloneable {

    private String name;

    public CloneSheep(String name) {
        this.name = name;
    }

    @Override
    public CloneSheep clone(){
        CloneSheep cloneSheep = null;
        try{
            cloneSheep = (CloneSheep)super.clone();
        }catch(CloneNotSupportedException e){
            e.printStackTrace();
        }
        return cloneSheep;
    }
}
